import { ApiProperty } from "@nestjs/swagger";
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity()
export class Type {
    constructor(typeId?: number, typeName?: string, isDefault?: number) {
        this.typeId = typeId;
        this.typeName = typeName;
        this.isDefault = isDefault;
    }

    @PrimaryGeneratedColumn({name: "type_id"})
    typeId: number;

    @ApiProperty({description: "种类名称"})
    @Column({name: "type_name", comment: "种类名称", length: 20, nullable: true})
    typeName: string;

    @ApiProperty({description: '是否默认（默认标识不可删除，仅管理员可操作）：0-否；1-是', example: 0})
    @Column({name:'is_default', comment: '是否默认（默认标识不可删除，仅管理员可操作）：0-否；1-是', default: 0})
    isDefault: number;
}